package peer;


import java.io.IOException;
import java.util.List;

import error.DgoogleException;
import file.LocalSharedFile;
import file.RemoteSharedFile;

/**
 * Protocol to talk with the bootstrap server.
 * 
 * @author Iris
 *
 */
public interface IBootProtocol {

	/** Is this connection already login? */
	boolean is_logined();
	
	/** Is this user already registered? */
	boolean is_registered();
	
	/** 
	 * Register to boot strap server.
	 * 
	 * @throws DgoogleException
	 */
	void register()  throws DgoogleException;

	/** Login to server */
	void login() throws DgoogleException;

	/** Close before you destroy protocol instance. 
	 * 
	 * @note   This is also means logout.*/
	void close();

	void resetPassword() throws DgoogleException;
	void error(String type, String details) throws DgoogleException;
	
	public void changePassword(String new_pass) throws DgoogleException;

	LocalSharedFile publish(String path) throws DgoogleException, IOException;

	List<RemoteSharedFile> query(String keyWord) throws DgoogleException;
}
